app.controller("z-salaryTotal-c",['$scope','$rootScope','$z-http','$sce','z-salaryDetail-s','z-dictionary-s','z-corporation-s','z-department-s','z-edit-menu-s','z-salaryRequest-s','$filter',
    function($scope,$rootScope,$zhttp,$sce,Service,DictionaryService,CorporationService,DepartmentService,MenuService,RequestService,$filter){
	$scope.viewModel = {};
	$scope.viewModel.perPage = "10";
	$scope.viewModel.rowCount = "1";
	$scope.viewModel.dataList=[];
	//下拉多选框长度
	$scope.multiSelectMaxHeight=300;
	$scope.corporationList = [];
	$scope.viewModel.employeeLevelList = [];
	$scope.viewModel.corporationList=[];
	$scope.viewModel.departmentList=[];
	$scope.viewModel.yearList = [];
	
	//查询页面名称
	MenuService.getMenuByUrl({url:'salaryTotal'},
	function(data){	
		$scope.viewModel.menuList=data;
	},function(error) {});
	
	var now = new Date();                    //当前日期     
	var nowMonth = now.getMonth();           //当前月     
	var nowYear=$filter('date')(now,'yyyy'); //当前年

    var year = (now).getFullYear();
    var month=nowMonth+1;
    for ( i=-3; i<4; i++ ) {
    	$scope.viewModel.yearList.push(year-i);
    }
	
    // 获取本月第一天
    $scope.viewModel.year = year;
    // 获取当前日期
    $scope.viewModel.month = month;
	
	$scope.viewModel.changePage = function () {
		$scope.viewModel.isPageTurning = '1';
        $scope.viewModel.bindData(false);
    };
	
	//加载信息
	$scope.viewModel.bindSelectRegionTypeData = function(){
		//查询公司
		CorporationService.getCorporationPermitList({
			//fromDate:$scope.viewModel.reportEndDate,
		},
		function(data){
			var site = [];  
	        $.each(data, function(index, values) {  
	            site.push({  
	                //label : "("+values.corporationCode+")"+values.corporationName,  
	            	label : values.corporationCode,  
	                value : values.corporationCode
	            });  
	        });
	        $scope.corporationList = site;
	        $('#salaryCorporation').multiselect('dataprovider',site);
		},function(error) {

		});
	};
	
	$scope.viewModel.bindSelectRegionTypeData();

	/*******使用为下拉带勾选控件*********/
	//员工级别
	$('#salarylevel').multiselect({
		includeSelectAllOption: true,
		enableFiltering: true,
		delimiterText: '; ',
        maxHeight: $scope.multiSelectMaxHeight
    });
	//公司
	$('#salaryCorporation').multiselect({
		includeSelectAllOption: true,
		enableFiltering: true,
		delimiterText: '; ',
        maxHeight: $scope.multiSelectMaxHeight
    });
	//公司选中事件
	$("#salaryCorporation").change(function(){  
		var value=$(this).val();
	    var data={};
	    data.corporationCodeList=value;
	    data.fromDate = $scope.viewModel.reportEndDate;
	    if(value==null){
	    	var site = [];  
	    	$('#salaryDepartmentName').multiselect('dataprovider',site);
	    	$scope.viewModel.departmentList=[];
	    }else{
	    	//查询部门
		    DepartmentService.getDepartmentListByCorporationCodeList(data,
			function(data){
		    	var site = [];  
		        $.each(data, function(index, values) {  
		            site.push({  
		                label : "("+values.departmentCode+")"+values.departmentName,  
		                value : values.departmentCode  
		            });  
		        });  
		        $('#salaryDepartmentName').multiselect('dataprovider',site);
			},function(error) {
				
			});
	    }
    });  
	
	//部门
	$('#salaryDepartmentName').multiselect({
		includeSelectAllOption: true,
		enableFiltering: true,
		delimiterText: '; ',
        maxHeight: $scope.multiSelectMaxHeight
    });

	$scope.viewModel.search = function() {
        $scope.viewModel.bindData();
	};
	
	//请求参数
	$scope.viewModel.getParamData = function(){
		$scope.viewModel.employeeList=[];
		if($scope.viewModel.employeeNo!=null){
			var employeeNoData = $scope.viewModel.employeeNo.split("\n");
			for(var i=0;i<employeeNoData.length;i++){
				$scope.viewModel.employeeList.push(employeeNoData[i]);
			}
		}
		
		var paramData={
				pageNo:$scope.viewModel.rowCount,
				pageCount:$scope.viewModel.perPage,
				salaryYear:$scope.viewModel.year,
				salaryMonth:$scope.viewModel.month,
				departmentList:$scope.viewModel.departmentList,
				corporationList:$scope.viewModel.corporationList,
				employeeList:$scope.viewModel.employeeList,
				employeeLevelList:$scope.viewModel.employeeLevelList
		};	
		
		return paramData;
	};
	
	
	//加载数据
	$scope.viewModel.bindData = function(){
		$scope.viewModel.isLoading=true;
		//获取基本信息
		Service.getSalaryTotalList($scope.viewModel.getParamData(),
			function(data){
				$scope.viewModel.dataList = data.salaryBeanList;
				$scope.viewModel.totalData = data.pageTotal;
				$scope.viewModel.isLoading=false;
			},function(error) {
				$scope.viewModel.isLoading=false;
				$rootScope.alertError(error.fault.message);
			});
	};
	
    //下载报表
    $scope.viewModel.download = function () {
        $scope.viewModel.isLoading = true;

        RequestService.getDownloadSalary(
        		$scope.viewModel.getParamData()
        ,function (data) {
            $scope.viewModel.isLoading = false;
            window.location.href = data;
        }, function (error) {
            $scope.viewModel.isLoading = false;
            $rootScope.alertError(error.fault.message);
        });
    };
    
  //表格按钮点击事件
	$scope.viewModel.salaryButton = function(e){
		e.stopPropagation();
		if($scope.viewModel.ulShow == false){
			$(".salaryUl").show();
			$scope.viewModel.ulShow = true;
		}else{
			$(".salaryUl").hide();
			$scope.viewModel.ulShow = false;
		}
	};
	$(document).click(function(){
		$(".salaryUl").hide();
		$scope.viewModel.ulShow = false;
	});
	$(".salaryUl").click(function(event){
		 event.stopPropagation();
	});
	// 定义表格下拉数据
	$scope.viewModel.checkList = [{dicId:"1",dicName:"一级架构"},
	                              {dicId:"2",dicName:"二级架构"},
	                              {dicId:"3",dicName:"三级架构"},
	                              {dicId:"4",dicName:"四级架构"},
	                              {dicId:"5",dicName:"工号"},
	                              {dicId:"6",dicName:"中文名"},
	                              {dicId:"7",dicName:"英文名"},
	                              {dicId:"8",dicName:"岗位"},
	                              {dicId:"9",dicName:"入职日期"},
	                              {dicId:"10",dicName:"离职日期"},
	                              {dicId:"11",dicName:"应出勤天数"},
	                              {dicId:"13",dicName:"迟到次数"},
	                              {dicId:"14",dicName:"迟到扣款"},
	                              {dicId:"15",dicName:"早退次数"},
	                              {dicId:"16",dicName:"早退扣款"},
	                              {dicId:"17",dicName:"旷工次数"},
	                              {dicId:"18",dicName:"补签次数"},
	                              {dicId:"19",dicName:"平日加班"},
	                              {dicId:"20",dicName:"双休加班"},
	                              {dicId:"21",dicName:"节日加班"},
	                              {dicId:"22",dicName:"年假"},
	                              {dicId:"23",dicName:"调休"},
	                              {dicId:"24",dicName:"事假"},
	                              {dicId:"25",dicName:"病假"},
	                              {dicId:"26",dicName:"婚假"},
	                              {dicId:"27",dicName:"产假"},
	                              {dicId:"28",dicName:"产检"},
	                              {dicId:"29",dicName:"陪护假"},
	                              {dicId:"30",dicName:"哺乳假"},
	                              {dicId:"31",dicName:"丧假"},              
	                              {dicId:"32",dicName:"备注"}];
	// 设置初始值
	$scope.viewModel.checkbox1 = true;
	$scope.viewModel.checkbox2 = true;
	$scope.viewModel.checkbox3 = true;
	$scope.viewModel.checkbox4 = true;
	$scope.viewModel.checkbox5 = true;
	$scope.viewModel.checkbox6 = true;
	$scope.viewModel.checkbox7 = true;
	$scope.viewModel.checkbox8 = true;
	$scope.viewModel.checkbox9 = true;
	$scope.viewModel.checkbox10 = true;
	$scope.viewModel.checkbox11 = true;
//	$scope.viewModel.checkbox12 = true;
	$scope.viewModel.checkbox13 = true;
	$scope.viewModel.checkbox14 = true;
	$scope.viewModel.checkbox15 = true;
    $scope.viewModel.checkbox16 = true;
	$scope.viewModel.checkbox17 = true;
	$scope.viewModel.checkbox18 = true;
	$scope.viewModel.checkbox19 = true;
	$scope.viewModel.checkbox20= true;
	$scope.viewModel.checkbox21 = true;
    $scope.viewModel.checkbox22 = true;
	$scope.viewModel.checkbox23 = true;
	$scope.viewModel.checkbox24 = true;
	$scope.viewModel.checkbox25 = true;
	$scope.viewModel.checkbox26= true;
	$scope.viewModel.checkbox27 = true;
	$scope.viewModel.checkbox28 = true;
	$scope.viewModel.checkbox29 = true;
	$scope.viewModel.checkbox30 = true;
	$scope.viewModel.checkbox31= true;
	$scope.viewModel.checkbox32 = true;
	
	var x=document.getElementById('salaryTatal-table').rows[0].cells;
	$scope.viewModel.checkbox = function(type){
		if(type == 1){
			if($scope.viewModel.checkbox1 == true){
				x[0].colSpan = x[0].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox1 == true || $scope.viewModel.checkbox2 == true || $scope.viewModel.checkbox3 == true || $scope.viewModel.checkbox4 == true || $scope.viewModel.checkbox5 == true || $scope.viewModel.checkbox6 == true || $scope.viewModel.checkbox7 == true || $scope.viewModel.checkbox8 == true || $scope.viewModel.checkbox9 == true || $scope.viewModel.checkbox10 == true){
					x[0].colSpan = x[0].colSpan * 1 + 1;
				}else{
					x[0].colSpan = x[0].colSpan;
					$("#salaryTatal-table thead tr th:eq(0)").show();
				}
			}
			$scope.viewModel.checkbox1 = !$scope.viewModel.checkbox1;
			if($scope.viewModel.checkbox1 == false && $scope.viewModel.checkbox2 == false && $scope.viewModel.checkbox3 == false && $scope.viewModel.checkbox4 == false && $scope.viewModel.checkbox5 == false && $scope.viewModel.checkbox6 == false && $scope.viewModel.checkbox7 == false && $scope.viewModel.checkbox8 == false && $scope.viewModel.checkbox9 == false && $scope.viewModel.checkbox10 == false){
				$("#salaryTatal-table thead tr th:eq(0)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(0)").show();
			}
		}
		if(type == 2){
			if($scope.viewModel.checkbox2 == true){
				x[0].colSpan = x[0].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox1 == true || $scope.viewModel.checkbox2 == true || $scope.viewModel.checkbox3 == true || $scope.viewModel.checkbox4 == true || $scope.viewModel.checkbox5 == true || $scope.viewModel.checkbox6 == true || $scope.viewModel.checkbox7 == true || $scope.viewModel.checkbox8 == true || $scope.viewModel.checkbox9 == true || $scope.viewModel.checkbox10 == true){
					x[0].colSpan = x[0].colSpan * 1 + 1;
				}else{
					x[0].colSpan = x[0].colSpan;
					$("#salaryTatal-table thead tr th:eq(0)").show();
				}
			}
			$scope.viewModel.checkbox2 = !$scope.viewModel.checkbox2;
			if($scope.viewModel.checkbox1 == false && $scope.viewModel.checkbox2 == false && $scope.viewModel.checkbox3 == false && $scope.viewModel.checkbox4 == false && $scope.viewModel.checkbox5 == false && $scope.viewModel.checkbox6 == false && $scope.viewModel.checkbox7 == false && $scope.viewModel.checkbox8 == false && $scope.viewModel.checkbox9 == false && $scope.viewModel.checkbox10 == false){
				$("#salaryTatal-table thead tr th:eq(0)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(0)").show();
			}
		}
		if(type == 3){
			if($scope.viewModel.checkbox3 == true){
				x[0].colSpan = x[0].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox1 == true || $scope.viewModel.checkbox2 == true || $scope.viewModel.checkbox3 == true || $scope.viewModel.checkbox4 == true || $scope.viewModel.checkbox5 == true || $scope.viewModel.checkbox6 == true || $scope.viewModel.checkbox7 == true || $scope.viewModel.checkbox8 == true || $scope.viewModel.checkbox9 == true || $scope.viewModel.checkbox10 == true){
					x[0].colSpan = x[0].colSpan * 1 + 1;
				}else{
					x[0].colSpan = x[0].colSpan;
					$("#salaryTatal-table thead tr th:eq(0)").show();
				}
			}
			$scope.viewModel.checkbox3 = !$scope.viewModel.checkbox3;
			if($scope.viewModel.checkbox1 == false && $scope.viewModel.checkbox2 == false && $scope.viewModel.checkbox3 == false && $scope.viewModel.checkbox4 == false && $scope.viewModel.checkbox5 == false && $scope.viewModel.checkbox6 == false && $scope.viewModel.checkbox7 == false && $scope.viewModel.checkbox8 == false && $scope.viewModel.checkbox9 == false && $scope.viewModel.checkbox10 == false){
				$("#salaryTatal-table thead tr th:eq(0)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(0)").show();
			}
		}
		if(type == 4){
			if($scope.viewModel.checkbox4 == true){
				x[0].colSpan = x[0].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox1 == true || $scope.viewModel.checkbox2 == true || $scope.viewModel.checkbox3 == true || $scope.viewModel.checkbox4 == true || $scope.viewModel.checkbox5 == true || $scope.viewModel.checkbox6 == true || $scope.viewModel.checkbox7 == true || $scope.viewModel.checkbox8 == true || $scope.viewModel.checkbox9 == true || $scope.viewModel.checkbox10 == true){
					x[0].colSpan = x[0].colSpan * 1 + 1;
				}else{
					x[0].colSpan = x[0].colSpan;
					$("#salaryTatal-table thead tr th:eq(0)").show();
				}
			}
			$scope.viewModel.checkbox4 = !$scope.viewModel.checkbox4;
			if($scope.viewModel.checkbox1 == false && $scope.viewModel.checkbox2 == false && $scope.viewModel.checkbox3 == false && $scope.viewModel.checkbox4 == false && $scope.viewModel.checkbox5 == false && $scope.viewModel.checkbox6 == false && $scope.viewModel.checkbox7 == false && $scope.viewModel.checkbox8 == false && $scope.viewModel.checkbox9 == false && $scope.viewModel.checkbox10 == false){
				$("#salaryTatal-table thead tr th:eq(0)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(0)").show();
			}
		}
		if(type == 5){
			if($scope.viewModel.checkbox5 == true){
				x[0].colSpan = x[0].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox1 == true || $scope.viewModel.checkbox2 == true || $scope.viewModel.checkbox3 == true || $scope.viewModel.checkbox4 == true || $scope.viewModel.checkbox5 == true || $scope.viewModel.checkbox6 == true || $scope.viewModel.checkbox7 == true || $scope.viewModel.checkbox8 == true || $scope.viewModel.checkbox9 == true || $scope.viewModel.checkbox10 == true){
					x[0].colSpan = x[0].colSpan * 1 + 1;
				}else{
					x[0].colSpan = x[0].colSpan;
					$("#salaryTatal-table thead tr th:eq(0)").show();
				}
			}
			$scope.viewModel.checkbox5 = !$scope.viewModel.checkbox5;
			if($scope.viewModel.checkbox1 == false && $scope.viewModel.checkbox2 == false && $scope.viewModel.checkbox3 == false && $scope.viewModel.checkbox4 == false && $scope.viewModel.checkbox5 == false && $scope.viewModel.checkbox6 == false && $scope.viewModel.checkbox7 == false && $scope.viewModel.checkbox8 == false && $scope.viewModel.checkbox9 == false && $scope.viewModel.checkbox10 == false){
				$("#salaryTatal-table thead tr th:eq(0)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(0)").show();
			}
		}
		if(type == 6){
			if($scope.viewModel.checkbox6 == true){
				x[0].colSpan = x[0].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox1 == true || $scope.viewModel.checkbox2 == true || $scope.viewModel.checkbox3 == true || $scope.viewModel.checkbox4 == true || $scope.viewModel.checkbox5 == true || $scope.viewModel.checkbox6 == true || $scope.viewModel.checkbox7 == true || $scope.viewModel.checkbox8 == true || $scope.viewModel.checkbox9 == true || $scope.viewModel.checkbox10 == true){
					x[0].colSpan = x[0].colSpan * 1 + 1;
				}else{
					x[0].colSpan = x[0].colSpan;
					$("#salaryTatal-table thead tr th:eq(0)").show();
				}
			}
			$scope.viewModel.checkbox6 = !$scope.viewModel.checkbox6;
			if($scope.viewModel.checkbox1 == false && $scope.viewModel.checkbox2 == false && $scope.viewModel.checkbox3 == false && $scope.viewModel.checkbox4 == false && $scope.viewModel.checkbox5 == false && $scope.viewModel.checkbox6 == false && $scope.viewModel.checkbox7 == false && $scope.viewModel.checkbox8 == false && $scope.viewModel.checkbox9 == false && $scope.viewModel.checkbox10 == false){
				$("#salaryTatal-table thead tr th:eq(0)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(0)").show();
			}
		}
		if(type == 7){
			if($scope.viewModel.checkbox7 == true){
				x[0].colSpan = x[0].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox1 == true || $scope.viewModel.checkbox2 == true || $scope.viewModel.checkbox3 == true || $scope.viewModel.checkbox4 == true || $scope.viewModel.checkbox5 == true || $scope.viewModel.checkbox6 == true || $scope.viewModel.checkbox7 == true || $scope.viewModel.checkbox8 == true || $scope.viewModel.checkbox9 == true || $scope.viewModel.checkbox10 == true){
					x[0].colSpan = x[0].colSpan * 1 + 1;
				}else{
					x[0].colSpan = x[0].colSpan;
					$("#salaryTatal-table thead tr th:eq(0)").show();
				}
			}
			$scope.viewModel.checkbox7 = !$scope.viewModel.checkbox7;
			if($scope.viewModel.checkbox1 == false && $scope.viewModel.checkbox2 == false && $scope.viewModel.checkbox3 == false && $scope.viewModel.checkbox4 == false && $scope.viewModel.checkbox5 == false && $scope.viewModel.checkbox6 == false && $scope.viewModel.checkbox7 == false && $scope.viewModel.checkbox8 == false && $scope.viewModel.checkbox9 == false && $scope.viewModel.checkbox10 == false){
				$("#salaryTatal-table thead tr th:eq(0)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(0)").show();
			}
		}
		if(type == 8){
			if($scope.viewModel.checkbox8 == true){
				x[0].colSpan = x[0].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox1 == true || $scope.viewModel.checkbox2 == true || $scope.viewModel.checkbox3 == true || $scope.viewModel.checkbox4 == true || $scope.viewModel.checkbox5 == true || $scope.viewModel.checkbox6 == true || $scope.viewModel.checkbox7 == true || $scope.viewModel.checkbox8 == true || $scope.viewModel.checkbox9 == true || $scope.viewModel.checkbox10 == true){
					x[0].colSpan = x[0].colSpan * 1 + 1;
				}else{
					x[0].colSpan = x[0].colSpan;
					$("#salaryTatal-table thead tr th:eq(0)").show();
				}
			}
			$scope.viewModel.checkbox8 = !$scope.viewModel.checkbox8;
			if($scope.viewModel.checkbox1 == false && $scope.viewModel.checkbox2 == false && $scope.viewModel.checkbox3 == false && $scope.viewModel.checkbox4 == false && $scope.viewModel.checkbox5 == false && $scope.viewModel.checkbox6 == false && $scope.viewModel.checkbox7 == false && $scope.viewModel.checkbox8 == false && $scope.viewModel.checkbox9 == false && $scope.viewModel.checkbox10 == false){
				$("#salaryTatal-table thead tr th:eq(0)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(0)").show();
			}
		}
		if(type == 9){
			if($scope.viewModel.checkbox9 == true){
				x[0].colSpan = x[0].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox1 == true || $scope.viewModel.checkbox2 == true || $scope.viewModel.checkbox3 == true || $scope.viewModel.checkbox4 == true || $scope.viewModel.checkbox5 == true || $scope.viewModel.checkbox6 == true || $scope.viewModel.checkbox7 == true || $scope.viewModel.checkbox8 == true || $scope.viewModel.checkbox9 == true || $scope.viewModel.checkbox10 == true){
					x[0].colSpan = x[0].colSpan * 1 + 1;
				}else{
					x[0].colSpan = x[0].colSpan;
					$("#salaryTatal-table thead tr th:eq(0)").show();
				}
			}
			$scope.viewModel.checkbox9 = !$scope.viewModel.checkbox9;
			if($scope.viewModel.checkbox1 == false && $scope.viewModel.checkbox2 == false && $scope.viewModel.checkbox3 == false && $scope.viewModel.checkbox4 == false && $scope.viewModel.checkbox5 == false && $scope.viewModel.checkbox6 == false && $scope.viewModel.checkbox7 == false && $scope.viewModel.checkbox8 == false && $scope.viewModel.checkbox9 == false && $scope.viewModel.checkbox10 == false){
				$("#salaryTatal-table thead tr th:eq(0)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(0)").show();
			}
		}
		if(type == 10){
			if($scope.viewModel.checkbox10 == true){
				x[0].colSpan = x[0].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox1 == true || $scope.viewModel.checkbox2 == true || $scope.viewModel.checkbox3 == true || $scope.viewModel.checkbox4 == true || $scope.viewModel.checkbox5 == true || $scope.viewModel.checkbox6 == true || $scope.viewModel.checkbox7 == true || $scope.viewModel.checkbox8 == true || $scope.viewModel.checkbox9 == true || $scope.viewModel.checkbox10 == true){
					x[0].colSpan = x[0].colSpan * 1 + 1;
				}else{
					x[0].colSpan = x[0].colSpan;
					$("#salaryTatal-table thead tr th:eq(0)").show();
				}
			}
			$scope.viewModel.checkbox10 = !$scope.viewModel.checkbox10;
			if($scope.viewModel.checkbox1 == false && $scope.viewModel.checkbox2 == false && $scope.viewModel.checkbox3 == false && $scope.viewModel.checkbox4 == false && $scope.viewModel.checkbox5 == false && $scope.viewModel.checkbox6 == false && $scope.viewModel.checkbox7 == false && $scope.viewModel.checkbox8 == false && $scope.viewModel.checkbox9 == false && $scope.viewModel.checkbox10 == false){
				$("#salaryTatal-table thead tr th:eq(0)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(0)").show();
			}
		}
		if(type == 11){
			if($scope.viewModel.checkbox11 == true){
				x[1].colSpan = x[1].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox11 == true){
					x[1].colSpan = x[1].colSpan * 1 + 1;
				}else{
					x[1].colSpan = x[1].colSpan;
					$("#salaryTatal-table thead tr th:eq(1)").show();
				}
			}
			$scope.viewModel.checkbox11 = !$scope.viewModel.checkbox11;
			if($scope.viewModel.checkbox11 == false){
				$("#salaryTatal-table thead tr th:eq(1)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(1)").show();
			}
		}
//		if(type == 12){
//			if($scope.viewModel.checkbox12 == true){
//				x[1].colSpan = x[1].colSpan - 1;
//			}else{
//				if($scope.viewModel.checkbox11 == true || $scope.viewModel.checkbox12 == true){
//					x[1].colSpan = x[1].colSpan * 1 + 1;
//				}else{
//					x[1].colSpan = x[1].colSpan;
//					$("#report-table thead tr th:eq(1)").show();
//				}
//			}
//			$scope.viewModel.checkbox12 = !$scope.viewModel.checkbox12;
//			if($scope.viewModel.checkbox11 == false && $scope.viewModel.checkbox12 == false){
//				$("#report-table thead tr th:eq(1)").hide();
//			}else{
//				$("#report-table thead tr th:eq(1)").show();
//			}
//		}
		if(type == 13){
			if($scope.viewModel.checkbox13 == true){
				x[2].colSpan = x[2].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox13 == true || $scope.viewModel.checkbox14 == true ||  $scope.viewModel.checkbox15== true || $scope.viewModel.checkbox16 == true || $scope.viewModel.checkbox17 == true || $scope.viewModel.checkbox18 == true){
					x[2].colSpan = x[2].colSpan * 1 + 1;
				}else{
					x[2].colSpan = x[2].colSpan;
					$("#salaryTatal-table thead tr th:eq(2)").show();
				}
			}
			$scope.viewModel.checkbox13 = !$scope.viewModel.checkbox13;
			if($scope.viewModel.checkbox13 == false && $scope.viewModel.checkbox14 == false && $scope.viewModel.checkbox15 == false && $scope.viewModel.checkbox16 == false && $scope.viewModel.checkbox17 == false && $scope.viewModel.checkbox18 == false){
				$("#salaryTatal-table thead tr th:eq(2)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(2)").show();
			}
		}
		if(type == 14){
			if($scope.viewModel.checkbox14 == true){
				x[2].colSpan = x[2].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox13 == true || $scope.viewModel.checkbox14 == true || $scope.viewModel.checkbox15 == true || $scope.viewModel.checkbox16 == true || $scope.viewModel.checkbox17 == true || $scope.viewModel.checkbox18 == true){
					x[2].colSpan = x[2].colSpan * 1 + 1;
				}else{
					x[2].colSpan = x[2].colSpan;
					$("#salaryTatal-table thead tr th:eq(2)").show();
				}
			}
			$scope.viewModel.checkbox14 = !$scope.viewModel.checkbox14;
			if($scope.viewModel.checkbox13 == false && $scope.viewModel.checkbox14 == false && $scope.viewModel.checkbox15 == false && $scope.viewModel.checkbox16 == false && $scope.viewModel.checkbox17 == false && $scope.viewModel.checkbox18 == false){
				$("#salaryTatal-table thead tr th:eq(2)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(2)").show();
			}
		}
		if(type == 15){
			if($scope.viewModel.checkbox15 == true){
				x[2].colSpan = x[2].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox13 == true || $scope.viewModel.checkbox14 == true ||  $scope.viewModel.checkbox15 == true || $scope.viewModel.checkbox16 == true || $scope.viewModel.checkbox17 == true || $scope.viewModel.checkbox18 == true){
					x[2].colSpan = x[2].colSpan * 1 + 1;
				}else{
					x[2].colSpan = x[2].colSpan;
					$("#salaryTatal-table thead tr th:eq(2)").show();
				}
			}
			$scope.viewModel.checkbox15 = !$scope.viewModel.checkbox15;
			if($scope.viewModel.checkbox13 == false && $scope.viewModel.checkbox15 == false && $scope.viewModel.checkbox17 == false && $scope.viewModel.checkbox171 == false){
				$("#salaryTatal-table thead tr th:eq(2)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(2)").show();
			}
		}
		if(type == 16){
			if($scope.viewModel.checkbox16 == true){
				x[2].colSpan = x[2].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox13 == true || $scope.viewModel.checkbox14 == true || $scope.viewModel.checkbox15 == true || $scope.viewModel.checkbox16 == true || $scope.viewModel.checkbox17 == true || $scope.viewModel.checkbox18 == true){
					x[2].colSpan = x[2].colSpan * 1 + 1;
				}else{
					x[2].colSpan = x[2].colSpan;
					$("#salaryTatal-table thead tr th:eq(2)").show();
				}
			}
			$scope.viewModel.checkbox16 = !$scope.viewModel.checkbox16;
			if($scope.viewModel.checkbox13 == false && $scope.viewModel.checkbox14 == false && $scope.viewModel.checkbox15 == false && $scope.viewModel.checkbox16 == false && $scope.viewModel.checkbox17 == false && $scope.viewModel.checkbox18== false){
				$("#rsalaryTatal-table thead tr th:eq(2)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(2)").show();
			}
		}
		if(type == 17){
			if($scope.viewModel.checkbox17 == true){
				x[2].colSpan = x[2].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox13 == true || $scope.viewModel.checkbox14 == true ||  $scope.viewModel.checkbox15 == true || $scope.viewModel.checkbox16 == true || $scope.viewModel.checkbox17 == true || $scope.viewModel.checkbox18 == true){
					x[2].colSpan = x[2].colSpan * 1 + 1;
				}else{
					x[2].colSpan = x[2].colSpan;
					$("#salaryTatal-table thead tr th:eq(2)").show();
				}
			}
			$scope.viewModel.checkbox17 = !$scope.viewModel.checkbox17;
			if($scope.viewModel.checkbox13 == false && $scope.viewModel.checkbox14 == false && $scope.viewModel.checkbox15 == false && $scope.viewModel.checkbox16 == false  && $scope.viewModel.checkbox17 == false  && $scope.viewModel.checkbox18 == false){
				$("#salaryTatal-table thead tr th:eq(2)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(2)").show();
			}
		}
		if(type == 18){
			if($scope.viewModel.checkbox18 == true){
				x[2].colSpan = x[2].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox13 == true || $scope.viewModel.checkbox14 == true ||  $scope.viewModel.checkbox15 == true || $scope.viewModel.checkbox16 == true || $scope.viewModel.checkbox17 == true || $scope.viewModel.checkbox18 == true){
					x[2].colSpan = x[2].colSpan * 1 + 1;
				}else{
					x[2].colSpan = x[2].colSpan;
					$("#salaryTatal-table thead tr th:eq(2)").show();
				}
			}
			$scope.viewModel.checkbox18 = !$scope.viewModel.checkbox18;
			if($scope.viewModel.checkbox13 == false && $scope.viewModel.checkbox14 == false && $scope.viewModel.checkbox15 == false && $scope.viewModel.checkbox16 == false  && $scope.viewModel.checkbox17 == false  && $scope.viewModel.checkbox18 == false){
				$("#salaryTatal-table thead tr th:eq(2)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(2)").show();
			}
		}
		if(type == 19){
			if($scope.viewModel.checkbox19== true){
				x[3].colSpan = x[3].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox19 == true ||  $scope.viewModel.checkbox20 == true ||  $scope.viewModel.checkbox21 == true){
					x[3].colSpan = x[3].colSpan * 1 + 1;
				}else{
					x[3].colSpan = x[3].colSpan;
					$("#salaryTatal-table thead tr th:eq(3)").show();
				}
			}
			$scope.viewModel.checkbox19 = !$scope.viewModel.checkbox19;
			if($scope.viewModel.checkbox19 == false && $scope.viewModel.checkbox20 == false && $scope.viewModel.checkbox21 == false){
				$("#salaryTatal-table thead tr th:eq(3)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(3)").show();
			}
		}
		if(type == 20){
			if($scope.viewModel.checkbox20 == true){
				x[3].colSpan = x[3].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox19 == true || $scope.viewModel.checkbox20 == true || $scope.viewModel.checkbox21 == true){
					x[3].colSpan = x[3].colSpan * 1 + 1;
				}else{
					x[3].colSpan = x[3].colSpan;
					$("#salaryTatal-table thead tr th:eq(3)").show();
				}
			}
			$scope.viewModel.checkbox20 = !$scope.viewModel.checkbox20;
			if($scope.viewModel.checkbox19 == false && $scope.viewModel.checkbox20 == false && $scope.viewModel.checkbox21 == false){
				$("#salaryTatal-table thead tr th:eq(3)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(3)").show();
			}
		}
		if(type == 21){
			if($scope.viewModel.checkbox21 == true){
				x[3].colSpan = x[3].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox19 == true || $scope.viewModel.checkbox20 == true || $scope.viewModel.checkbox21== true){
					x[3].colSpan = x[3].colSpan * 1 + 1;
				}else{
					x[3].colSpan = x[3].colSpan;
					$("#salaryTatal-table thead tr th:eq(3)").show();
				}
			}
			$scope.viewModel.checkbox21 = !$scope.viewModel.checkbox21;
			if($scope.viewModel.checkbox19 == false && $scope.viewModel.checkbox20 == false && $scope.viewModel.checkbox21 == false){
				$("#salaryTatal-table thead tr th:eq(3)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(3)").show();
			}
		}    
	

		if(type == 22){
			if($scope.viewModel.checkbox22 == true){
				x[4].colSpan = x[4].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox22 == true || $scope.viewModel.checkbox23 == true || $scope.viewModel.checkbox24 == true || $scope.viewModel.checkbox25 == true || $scope.viewModel.checkbox26 == true || $scope.viewModel.checkbox27 == true || $scope.viewModel.checkbox28 == true || $scope.viewModel.checkbox29 == true || $scope.viewModel.checkbox30 == true || $scope.viewModel.checkbox31 == true){
					x[4].colSpan = x[4].colSpan * 1 + 1;
				}else{
					x[4].colSpan = x[4].colSpan;
					$("#salaryTatal-table thead tr th:eq(4)").show();
				}
			}
			$scope.viewModel.checkbox22 = !$scope.viewModel.checkbox22;
			if($scope.viewModel.checkbox22 == false && $scope.viewModel.checkbox23 == false && $scope.viewModel.checkbox24 == false && $scope.viewModel.checkbox25== false && $scope.viewModel.checkbox26 == false && $scope.viewModel.checkbox27 == false && $scope.viewModel.checkbox28 == false && $scope.viewModel.checkbox29 == false && $scope.viewModel.checkbox30 == false && $scope.viewModel.checkbox31 == false){
				$("#salaryTatal-table thead tr th:eq(4)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(4)").show();
			}
		}
		
		if(type == 23){
			if($scope.viewModel.checkbox23 == true){
				x[4].colSpan = x[4].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox22 == true || $scope.viewModel.checkbox23 == true || $scope.viewModel.checkbox24 == true || $scope.viewModel.checkbox25 == true || $scope.viewModel.checkbox26 == true || $scope.viewModel.checkbox27 == true || $scope.viewModel.checkbox28 == true || $scope.viewModel.checkbox29 == true || $scope.viewModel.checkbox30 == true || $scope.viewModel.checkbox31 == true){
					x[4].colSpan = x[4].colSpan * 1 + 1;
				}else{
					x[4].colSpan = x[4].colSpan;
					$("#salaryTatal-table thead tr th:eq(4)").show();
				}
			}
			$scope.viewModel.checkbox23 = !$scope.viewModel.checkbox23;
			if($scope.viewModel.checkbox22 == false && $scope.viewModel.checkbox23 == false && $scope.viewModel.checkbox24 == false && $scope.viewModel.checkbox25== false && $scope.viewModel.checkbox26 == false && $scope.viewModel.checkbox27 == false && $scope.viewModel.checkbox28 == false && $scope.viewModel.checkbox29 == false && $scope.viewModel.checkbox30 == false && $scope.viewModel.checkbox31 == false){
				$("#salaryTatal-table thead tr th:eq(4)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(4)").show();
			}
		}
		
		if(type == 24){
			if($scope.viewModel.checkbox24 == true){
				x[4].colSpan = x[4].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox22 == true || $scope.viewModel.checkbox23 == true || $scope.viewModel.checkbox24 == true || $scope.viewModel.checkbox25 == true || $scope.viewModel.checkbox26 == true || $scope.viewModel.checkbox27 == true || $scope.viewModel.checkbox28 == true || $scope.viewModel.checkbox29 == true || $scope.viewModel.checkbox30 == true || $scope.viewModel.checkbox31 == true){
					x[4].colSpan = x[4].colSpan * 1 + 1;
				}else{
					x[4].colSpan = x[4].colSpan;
					$("#salaryTatal-table thead tr th:eq(4)").show();
				}
			}
			$scope.viewModel.checkbox24 = !$scope.viewModel.checkbox24;
			if($scope.viewModel.checkbox22 == false && $scope.viewModel.checkbox23 == false && $scope.viewModel.checkbox24 == false && $scope.viewModel.checkbox25== false && $scope.viewModel.checkbox26 == false && $scope.viewModel.checkbox27 == false && $scope.viewModel.checkbox28 == false && $scope.viewModel.checkbox29 == false && $scope.viewModel.checkbox30 == false && $scope.viewModel.checkbox31 == false){
				$("#salaryTatal-table thead tr th:eq(4)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(4)").show();
			}
		}
		
		if(type == 25){
			if($scope.viewModel.checkbox25 == true){
				x[4].colSpan = x[4].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox22 == true || $scope.viewModel.checkbox23 == true || $scope.viewModel.checkbox24 == true || $scope.viewModel.checkbox25 == true || $scope.viewModel.checkbox26 == true || $scope.viewModel.checkbox27 == true || $scope.viewModel.checkbox28 == true || $scope.viewModel.checkbox29 == true || $scope.viewModel.checkbox30 == true || $scope.viewModel.checkbox31 == true){
					x[4].colSpan = x[4].colSpan * 1 + 1;
				}else{
					x[4].colSpan = x[4].colSpan;
					$("#salaryTatal-table thead tr th:eq(4)").show();
				}
			}
			$scope.viewModel.checkbox25 = !$scope.viewModel.checkbox25;
			if($scope.viewModel.checkbox22 == false && $scope.viewModel.checkbox23 == false && $scope.viewModel.checkbox24 == false && $scope.viewModel.checkbox25== false && $scope.viewModel.checkbox26 == false && $scope.viewModel.checkbox27 == false && $scope.viewModel.checkbox28 == false && $scope.viewModel.checkbox29 == false && $scope.viewModel.checkbox30 == false && $scope.viewModel.checkbox31 == false){
				$("#salaryTatal-table thead tr th:eq(4)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(4)").show();
			}
		}
		
		if(type == 26){
			if($scope.viewModel.checkbox26 == true){
				x[4].colSpan = x[4].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox22 == true || $scope.viewModel.checkbox23 == true || $scope.viewModel.checkbox24 == true || $scope.viewModel.checkbox25 == true || $scope.viewModel.checkbox26 == true || $scope.viewModel.checkbox27 == true || $scope.viewModel.checkbox28 == true || $scope.viewModel.checkbox29 == true || $scope.viewModel.checkbox30 == true || $scope.viewModel.checkbox31 == true){
					x[4].colSpan = x[4].colSpan * 1 + 1;
				}else{
					x[4].colSpan = x[4].colSpan;
					$("#salaryTatal-table thead tr th:eq(4)").show();
				}
			}
			$scope.viewModel.checkbox26 = !$scope.viewModel.checkbox26;
			if($scope.viewModel.checkbox22 == false && $scope.viewModel.checkbox23 == false && $scope.viewModel.checkbox24 == false && $scope.viewModel.checkbox25== false && $scope.viewModel.checkbox26 == false && $scope.viewModel.checkbox27 == false && $scope.viewModel.checkbox28 == false && $scope.viewModel.checkbox29 == false && $scope.viewModel.checkbox30 == false && $scope.viewModel.checkbox31 == false){
				$("#salaryTatal-table thead tr th:eq(4)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(4)").show();
			}
		}
		
		if(type == 27){
			if($scope.viewModel.checkbox27 == true){
				x[4].colSpan = x[4].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox22 == true || $scope.viewModel.checkbox23 == true || $scope.viewModel.checkbox24 == true || $scope.viewModel.checkbox25 == true || $scope.viewModel.checkbox26 == true || $scope.viewModel.checkbox27 == true || $scope.viewModel.checkbox28 == true || $scope.viewModel.checkbox29 == true || $scope.viewModel.checkbox30 == true || $scope.viewModel.checkbox31 == true){
					x[4].colSpan = x[4].colSpan * 1 + 1;
				}else{
					x[4].colSpan = x[4].colSpan;
					$("#salaryTatal-table thead tr th:eq(4)").show();
				}
			}
			$scope.viewModel.checkbox27 = !$scope.viewModel.checkbox27;
			if($scope.viewModel.checkbox22 == false && $scope.viewModel.checkbox23 == false && $scope.viewModel.checkbox24 == false && $scope.viewModel.checkbox25== false && $scope.viewModel.checkbox26 == false && $scope.viewModel.checkbox27 == false && $scope.viewModel.checkbox28 == false && $scope.viewModel.checkbox29 == false && $scope.viewModel.checkbox30 == false && $scope.viewModel.checkbox31 == false){
				$("#salaryTatal-table thead tr th:eq(4)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(4)").show();
			}
		}
		
		if(type == 28){
			if($scope.viewModel.checkbox28 == true){
				x[4].colSpan = x[4].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox22 == true || $scope.viewModel.checkbox23 == true || $scope.viewModel.checkbox24 == true || $scope.viewModel.checkbox25 == true || $scope.viewModel.checkbox26 == true || $scope.viewModel.checkbox27 == true || $scope.viewModel.checkbox28 == true || $scope.viewModel.checkbox29 == true || $scope.viewModel.checkbox30 == true || $scope.viewModel.checkbox31 == true){
					x[4].colSpan = x[4].colSpan * 1 + 1;
				}else{
					x[4].colSpan = x[4].colSpan;
					$("#salaryTatal-table thead tr th:eq(4)").show();
				}
			}
			$scope.viewModel.checkbox28 = !$scope.viewModel.checkbox28;
			if($scope.viewModel.checkbox22 == false && $scope.viewModel.checkbox23 == false && $scope.viewModel.checkbox24 == false && $scope.viewModel.checkbox25== false && $scope.viewModel.checkbox26 == false && $scope.viewModel.checkbox27 == false && $scope.viewModel.checkbox28 == false && $scope.viewModel.checkbox29 == false && $scope.viewModel.checkbox30 == false && $scope.viewModel.checkbox31 == false){
				$("#salaryTatal-table thead tr th:eq(4)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(4)").show();
			}
		}
		
		if(type == 29){
			if($scope.viewModel.checkbox29 == true){
				x[4].colSpan = x[4].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox22 == true || $scope.viewModel.checkbox23 == true || $scope.viewModel.checkbox24 == true || $scope.viewModel.checkbox25 == true || $scope.viewModel.checkbox26 == true || $scope.viewModel.checkbox27 == true || $scope.viewModel.checkbox28 == true || $scope.viewModel.checkbox29 == true || $scope.viewModel.checkbox30 == true || $scope.viewModel.checkbox31 == true){
					x[4].colSpan = x[4].colSpan * 1 + 1;
				}else{
					x[4].colSpan = x[4].colSpan;
					$("#salaryTatal-table thead tr th:eq(4)").show();
				}
			}
			$scope.viewModel.checkbox29 = !$scope.viewModel.checkbox29;
			if($scope.viewModel.checkbox22 == false && $scope.viewModel.checkbox23 == false && $scope.viewModel.checkbox24 == false && $scope.viewModel.checkbox25== false && $scope.viewModel.checkbox26 == false && $scope.viewModel.checkbox27 == false && $scope.viewModel.checkbox28 == false && $scope.viewModel.checkbox29 == false && $scope.viewModel.checkbox30 == false && $scope.viewModel.checkbox31 == false){
				$("#salaryTatal-table thead tr th:eq(4)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(4)").show();
			}
		}
		
		
		if(type == 30){
			if($scope.viewModel.checkbox30 == true){
				x[4].colSpan = x[4].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox22 == true || $scope.viewModel.checkbox23 == true || $scope.viewModel.checkbox24 == true || $scope.viewModel.checkbox25 == true || $scope.viewModel.checkbox26 == true || $scope.viewModel.checkbox27 == true || $scope.viewModel.checkbox28 == true || $scope.viewModel.checkbox29 == true || $scope.viewModel.checkbox30 == true || $scope.viewModel.checkbox31 == true){
					x[4].colSpan = x[4].colSpan * 1 + 1;
				}else{
					x[4].colSpan = x[4].colSpan;
					$("#salaryTatal-table thead tr th:eq(4)").show();
				}
			}
			$scope.viewModel.checkbox30 = !$scope.viewModel.checkbox30;
			if($scope.viewModel.checkbox22 == false && $scope.viewModel.checkbox23 == false && $scope.viewModel.checkbox24 == false && $scope.viewModel.checkbox25== false && $scope.viewModel.checkbox26 == false && $scope.viewModel.checkbox27 == false && $scope.viewModel.checkbox28 == false && $scope.viewModel.checkbox29 == false && $scope.viewModel.checkbox30 == false && $scope.viewModel.checkbox31 == false){
				$("#salaryTatal-table thead tr th:eq(4)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(4)").show();
			}
		}
		
		
		if(type == 31){
			if($scope.viewModel.checkbox31 == true){
				x[4].colSpan = x[4].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox22 == true || $scope.viewModel.checkbox23 == true || $scope.viewModel.checkbox24 == true || $scope.viewModel.checkbox25 == true || $scope.viewModel.checkbox26 == true || $scope.viewModel.checkbox27 == true || $scope.viewModel.checkbox28 == true || $scope.viewModel.checkbox29 == true || $scope.viewModel.checkbox30 == true || $scope.viewModel.checkbox31 == true){
					x[4].colSpan = x[4].colSpan * 1 + 1;
				}else{
					x[4].colSpan = x[4].colSpan;
					$("#salaryTatal-table thead tr th:eq(4)").show();
				}
			}
			$scope.viewModel.checkbox31 = !$scope.viewModel.checkbox31;
			if($scope.viewModel.checkbox22 == false && $scope.viewModel.checkbox23 == false && $scope.viewModel.checkbox24 == false && $scope.viewModel.checkbox25== false && $scope.viewModel.checkbox26 == false && $scope.viewModel.checkbox27 == false && $scope.viewModel.checkbox28 == false && $scope.viewModel.checkbox29 == false && $scope.viewModel.checkbox30 == false && $scope.viewModel.checkbox31 == false){
				$("#salaryTatal-table thead tr th:eq(4)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(4)").show();
			}
		}
		
		if(type == 32){
			if($scope.viewModel.checkbox32 == true){
				x[6].colSpan = x[6].colSpan - 1;
			}else{
				if($scope.viewModel.checkbox32 == true){
					x[6].colSpan = x[6].colSpan * 1 + 1;
				}else{
					x[6].colSpan = x[6].colSpan;
					$("#salaryTatal-table thead tr th:eq(6)").show();
				}
			}
			$scope.viewModel.checkbox32 = !$scope.viewModel.checkbox32;
			if($scope.viewModel.checkbox32 == false){
				$("#salaryTatal-table thead tr th:eq(6)").hide();
			}else{
				$("#salaryTatal-table thead tr th:eq(6)").show();
			}
		}
	}
} ]);